﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using IndoReputation.Commons;

namespace IndoReputation.Views.ViewModels
{
    public class OfficeViewModel
    {
        public int ID { get; set; }

        [Required(ErrorMessage = "Please choose Office Type")]
        [Range(1, Int32.MaxValue, ErrorMessage = "Please choose Office Type")]
        public int OfficeTypeID { get; set; }

        public IEnumerable<SelectListItem> OfficeType { get; set; }

        [Required(ErrorMessage = "Please choose City")]
        public int CityId { get; set; }

        public IEnumerable<SelectListItem> City { get; set; }

        [Required(ErrorMessage = "Please choose Country")]
        public int CountryID { get; set; }

        public IEnumerable<SelectListItem> Country { get; set; }

        [Required(ErrorMessage = "Please type the Name")]
        [StringLength(256, ErrorMessage = "String may not be longer than 256 characters")]
        [PlaceHolder("Enter name here")]
        public string Name { get; set; }

        [DataType(DataType.MultilineText)]
        [StringLength(512, ErrorMessage = "String may not be longer than 512 characters")]
        [PlaceHolder("Enter description here")]
        public string Description { get; set; }

        public DateTime? CreateAt { get; set; }

        public int? CreateBy { get; set; }

        private bool? _IsEnable = true;
        public bool IsEnable
        {
            get { return _IsEnable ?? false; }
            set { _IsEnable = value; }
        }
    }
}